<template>
	<view class="limit-goods" >
		<view class="panel c-flex c-item-center">
			<view class="goodImg c-flex">
				<image :src="goods.pic"></image>
			</view>
			<view class="goodInfo">
				<view class="g-1 c-flex jc-between">
					<view>{{goods.name}}</view>
					<view>已售{{goods.saleCount || 0}}</view>
				</view>
				<view class="g-2 c-flex">
					<view>{{goods.type ===0?'民用':goods.type ===1?'商业':'工业'}}</view>
					<view>|</view>
					<view>{{goods.subTitle || ''}}</view>
				</view>
				<view class="g-3 c-flex jc-between">
					<view>{{goods.price}}<text>元</text></view>
					<count :goodItem='goods'></count>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	
	//import util from '@/utils/util.js';
	
	import count from '@/components/addCart/count.vue'
	
export default {
	nmae: 'ShopLimitGoods',
	props: {
		//客户类型0民用1商业2工业

		type: {
			type: [Number, String],
			default: 0
		},
		goods: {
			type: Object,
			default: () => {
				return {};
			}
		},
		refreshCount: {
			type: Boolean,
			default: true
		}
	},
	components:{
		count
	},
	watch: {
		
	},
	data() {
		return {
			
			recommend:'recommend',
			isBool:false,
			goodsItem:null,
			currency: '￥',
			goodsHeight: ''
		};
	},
	mounted() {
		
		if(this.type == 2) {
			const sysInfo = uni.getSystemInfoSync()
			const windowWidth = sysInfo.windowWidth
			this.goodsHeight = ((windowWidth-70)/3).toFixed(2) + "px"
		}
	},
	methods: {

	}
};


</script>

<style lang="scss" scoped>
.limit-goods {
	
	.panel{
		width: 710rpx;
		height: 216rpx;
		background: #FFFFFF;
		border-radius: 14rpx;
		margin: 0 auto;
		.goodImg {
			width: 160rpx;
			height: 160rpx;
			background: #F6F6F6;
			border-radius: 14rpx;
			margin-left: 20rpx;
			image {
				width:100%;
				height:100%;
			}
		}
		.goodInfo{
			width: 68%;
			margin-left: 24rpx;
			.g-1{
				
				
				view:nth-child(1){
					font-family: PingFang-SC, PingFang-SC;
					font-weight: 800;
					font-size: 28rpx;
					color: #191919;
				}
				view:nth-child(2){
					font-family: PingFang-SC, PingFang-SC;
					font-weight: 500;
					font-size: 22rpx;
					color: #8B959F;
				}
			}
			
			.g-2{
				margin-top: 16rpx;
				view:nth-child(1){
					font-family: PingFang-SC, PingFang-SC;
					font-weight: 500;
					font-size: 22rpx;
					color: #E86748;
				}
				view:nth-child(2){
					margin: 0 20rpx;
					font-size: 22rpx;
					color: #8B959F;
				}
				view:nth-child(3){
					font-family: PingFang-SC, PingFang-SC;
					font-weight: 500;
					font-size: 22rpx;
					color: #8B959F;
				}
			}
			.g-3{
				margin-top: 16rpx;
				font-family: DINAlternate, DINAlternate;
				color: #F2270B;
				view{
					
					font-weight: bold;
					font-size: 40rpx;
					
					text{
					
						font-weight: 400;
						font-size: 20rpx;
						
					}
				}
				
			}
		}
		
	}
}
	
</style>
